package model.effects;

import model.entity.Entity;
import model.map.MapPoint;

public class Teleport extends Effect{
	private MapPoint direction;
	private int baseValue;
	private boolean didEffect;
	
	public Teleport(int baseValue, MapPoint direction){
		this.baseValue = baseValue;
		this.direction = direction;
		this.didEffect = false;
	}
	@Override
	public void modifyParameter(double modification) {
		double temp = modification * baseValue;
		baseValue = (int) temp;
		
	}

	@Override
	public void doEffect(Entity e) {
		if(100*Math.random() <= baseValue){
			// TODO teleport the entity;
			this.didEffect = true;
		}
	}

	@Override
	public String toString(double factor) {
		double didEffect = this.didEffect ? 1 : 0;
		didEffect += (.01 * factor);
		
		return didEffect > .5 ? "was teleported :)." : "was not teleported :(.";
	}
}
